package com.dc.datacollect.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.Objects;

import lombok.Data;

/**
 * 
 * @TableName part
 */
@TableName(value ="part")
@Data
public class Part implements Serializable {
    /**
     * 参与id
     */
    @TableId
    private Long id;

    /**
     * 参与的用户id
     */
    private Long userId;

    /**
     * 所在的收集组id
     */
    private Long groupId;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private Date gmtCreate;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date gmtModified;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Part part = (Part) o;
        return Objects.equals(id, part.id) && Objects.equals(userId, part.userId) && Objects.equals(groupId, part.groupId) && Objects.equals(gmtCreate, part.gmtCreate) && Objects.equals(gmtModified, part.gmtModified);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, userId, groupId, gmtCreate, gmtModified);
    }
}